MLE of distributions for compositional data.
comp.mle(x, distr = "diri", type = 1, a = NULL, tol = 1e-07)
A list including:
The value of the log-likelihood.
The estimated parameters.
The precision parameter. If covariates are linked with it (function "diri.reg2"), this will be a vector.
The mean vector of the distribution.
The time required by the MLE.
The estimated optimal \(\alpha\) of the folded model.
The estimated probability inside the simplex of the folded model.
The estimated mean vector of the folded model.
The estimated covariance matrix of the folded model.
A matrix containing the compositional data. Zero values are not allowed except for the case of the ZAD which is designed for the case of zero values present.
The distribution to fit. "diri" stands for the Dirichlet distribution, "zad" is the Zero Adjusted Dirichlet distribution and "afolded" for the \(\alpha\)-folded model (Tsagris and Stewart, 2020).
This is for the Dirichlet distribution ("diri"). Type 1 uses a vectorised version of the Newton-Raphson (Minka, 2012). In high dimensions this is to be preferred. If the data are too concentrated, regardless of the dimensions, this is also to be preferrred. Type 2 uses the regular Newton-Raphson, with matrix multiplications. In small dimensions this can be considerably faster.
The value of \(\alpha\). If this is NULL, the function will estimate it internally.
The tolerance level idicating no further increase in the log-likelihood.
Michail Tsagris and Sofia Piperaki.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr and Sofia Piperaki sofiapip23@gmail.com.
Maximum likelihood estimation of the parameters of a Dirichlet distribution is performed via Newton-Raphson. Initial values suggested by Minka (2012) are used.
Minka Thomas (2012). Estimating a Dirichlet distribution. Technical report.
Ng Kai Wang, Guo-Liang Tian, and Man-Lai Tang (2011). Dirichlet and related distributions: Theory, methods and applications. John Wiley & Sons.
Tsagris M. and Stewart C. (2018). A Dirichlet regression model for compositional data with zeros. Lobachevskii Journal of Mathematics, 39(3): 398--412. Preprint available from https://arxiv.org/pdf/1410.5011.pdf
Tsagris M. and Stewart C. (2022). A Review of Flexible Transformations for Modeling Compositional Data. In Advances and Innovations in Statistics and Data Science, pp. 225--234. https://link.springer.com/chapter/10.1007/978-3-031-08329-7_10
Tsagris M. and Stewart C. (2020). A folded model for compositional data analysis. Australian and New Zealand Journal of Statistics, 62(2): 249--277. https://arxiv.org/pdf/1802.07330.pdf
prop.mle
x <- matrix( rgamma(100 * 4, c(5, 6, 7, 8), 1), ncol = 4)
x <- x / rowSums(x)
res <- comp.mle(x)
Run the code above in your browser using DataLab